package com.basic.controller;

import com.basic.feign.ShopinfoFeign;
import com.code.domain.AjaxResult;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@ApiOperation(value = "商家",notes = "商家")
@Controller
@RequestMapping(value = "/basic/shopinfo")
@Slf4j
@CrossOrigin
public class ShopinfoBasicController {

    @Autowired
    private ShopinfoFeign shopinfoFeign;


    @ApiOperation(value = "查询所有商家",notes = "查询所有商家")
    @GetMapping(value = "/queryBasiShopinfo")
    public @ResponseBody AjaxResult queryBasiShopinfo(HttpServletRequest request, HttpServletResponse response){
       AjaxResult ajaxResult =  shopinfoFeign.queryShopinfo();
        return AjaxResult.success("操作成功",ajaxResult.get("data"));
    }


}
